import openpyxl

myBook=openpyxl.load_workbook('收入表.xlsx',data_only=True)
mySheet=myBook.active
myValues=list(mySheet.values)
myNewBook=openpyxl.Workbook()
myNewSheet=myNewBook.active
myNewSheet.title='收入表'

myNewSheet.append(['姓名','月份','金额'])
for myRow in myValues[1:]:
	mySum=0
	myMonth=0
	for myCell in myRow[1:]:
		myMonth+=1
		mySum+=myCell
		if mySum>=10000:
			myNewSheet.append([myRow[0],str(myMonth)+'月份',mySum])
			break

myNewBook.save('收入表.xlsx')